import sys

from PySide6.QtCore import QSize, Qt
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.label = QLabel("Click in this window")
        self.status = self.statusBar()
        self.setFixedSize(QSize(200, 100))
        self.setCentralWidget(self.label)

    def mouseMoveEvent(self, e):
        self.label.setText("MouseMoveEvent")

    def mousePressEvent(self, e):
        button  = e.button()
        if button == Qt.LeftButton:
            self.label.setText("MousePressEvent LEFT")
            if e.x() < 100:
                self.status.showMessage("Left click on left")
                self.move(self.x() - 10, self.y())
            else:
                self.status.showMessage("Left click on right")
                self.move(self.x() + 10, self.y())

        elif button == Qt.MiddleButton:
            self.label.setText("MousePressEvent MIDDLE")

        elif button == Qt.RightButton:
            self.label.setText("MousePressEvent RIGHT")
            if e.x() < 100:
                self.status.showMessage("Right click on left")
                self.move(10, 10)
            else:
                self.status.showMessage("Right click on right")
                self.move(400, 400)


app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()